* fix cppcheck constVariable warnings.
* guard against qt container detachement.
fit_write_msg_event(track_date_time, kEventTimer, kEventTypeStart, 0);
// Write track/course points for the whole track
- for (auto& crpt: course) {
+ for (const auto& crpt: course) {
if (crpt.is_course_point) {
fit_write_msg_course_point(crpt.creation_time,
crpt.lat,
gbser_handle* h = gbser_get_handle(handle);
speed_t s;
- static unsigned bit_flags[] = {
+ static const unsigned bit_flags[] = {
0, 0, 0, 0, 0, CS5, CS6, CS7, CS8
};
}
counter = 0;
if (global_opts.debug_level >= 5) {
- for (auto& entry : history) {
- auto [pos, avc, alt] = entry;
+ for (const auto& [pos, avc, alt] : qAsConst(history)) {
qDebug() << "initial conditions" << pos << avc << alt;
}
qDebug() << "initial accumulator" << accumulated_position << accumulated_altitude_valid_count << accumulated_altitude;
time_t
mkgmtime(struct tm* t)
{
- static int m_to_d[12] =
+ static const int m_to_d[12] =
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
short month = t->tm_mon;